﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Point2d.Graphics
{
    public class EntityFactory
    {
        GraphicsManager _graphicsManager = null;

        public EntityFactory(GraphicsManager graphicsManager)
        {
            _graphicsManager = graphicsManager;
        }

        //public void NewPoint(float x, float y, int level = 0)
        //{
        //    PointEntity pointEntity = new PointEntity(_graphicsManager);
        //    pointEntity.AddPoint(x, y);

        //    if (_entities.ContainsKey(level) == false)
        //    {
        //        _entities.Add(level, new List<Entity>());
        //    }

        //    _entities[level].Add(pointEntity);
        //}

        public Entity Create(Entity.EntityType entityType, System.Drawing.Color color)
        {
            Entity entity = null;
            switch (entityType)
            {
                case Entity.EntityType.ePoint:
                    entity = new PointEntity(_graphicsManager, color);
                    break;

                case Entity.EntityType.eLineStrip:
                    entity = new LineStripEntity(_graphicsManager, color);
                    break;
            }

            return entity;
        }
    }
}
